package com.mep.backup.bifeign;

import com.mep.common.http.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "story-auth/user", path = "/", fallback = IFeignSysUserApi.FeignClientFallback.class)
public interface IFeignSysUserApi {


    @PostMapping(value="/findByName")
    HttpResult findByName(@RequestParam String name);

    @Component
    class FeignClientFallback implements IFeignSysUserApi {

        @Override
        public HttpResult findByName(String name) {
            return HttpResult.error(409, "熔断超时返回");
        }
    }
}
